﻿Imports System.Xml.XPath

Partial Public Class _Default
    Inherits System.Web.UI.Page

    Public xmldoc As XPathDocument
    Public navi As XPathNavigator

    Sub New()
        xmldoc = New XPathDocument("E:/Project SimpleCMS/Content/MainPageContent.xml")
        navi = xmldoc.CreateNavigator()
    End Sub


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Dim id As String = "rightColumn-layout2"
        MenuOne.InnerText = ReadXml(Content.Constants.MenuOne)
        RightHeading.InnerText = ReadXml("page/body/form/div/div/div[@id='rightColumn-layout2']/h2")
        RightTopContent.InnerText = ReadXml("page/body/form/div/div/div[@id='rightColumn-layout2']/p[@id='RightTopContent']")
        RightBottomContent.InnerText = ReadXml("page/body/form/div/div/div[@id='rightColumn-layout2']/p[@id='RightBottomContent']")
    End Sub


    Function ReadXml(ByVal node As String) As String
        Dim value As String
        ' For Each question As XPathNavigator In navi.Select("Quiz/QA")
        value = (navi.SelectSingleNode(node).Value)
        'Next
        Return value
    End Function

End Class